﻿@model eShop.Web.Models.FullSendMainProductListModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>满赠商品列表-@{@WorkContext.ShopConfig.SiteTitle}</title>
    @Html.Raw(WorkContext.ShopConfig.SEOKeyword)
    @Html.Raw(WorkContext.ShopConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/themes/default/css/list.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/jquery.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        isGuestSC = @WorkContext.ShopConfig.IsGuestSC;
        scSubmitType = @WorkContext.ShopConfig.SCSubmitType;
    </script>
</head>

<body>
@Html.Partial("_header")

<br />

<script type="text/javascript">
    //删除购物车中商品
    function delCartProduct(pid) {
        if (isGuestSC == 0 && uid < 1) {
            alert("请先登录");
            return;
        }
        $.get("/cart/delpruduct?pid=" + pid, function (data) {
            try {
                alert(val("(" + data + ")").content);
            }
            catch (ex) {
                $("#item" + pid).remove();
            }
        })
    }
</script>

<div class="box">
<div id="listL"></div>
<div id="listR">
@{
    List<OrderProductInfo> list = Carts.GetFullSendMainOrderProductList(Model.PmId, Model.OrderProductList);
    }
<div class="single float-nav-wrap mt">
  <div class="full">
    <div id="icon" class="s-full"></div>
    <div class="total">已加入购物车的活动商品&nbsp;&nbsp;共<font>@Carts.SumOrderProductCount(list)</font>件 总计<strong>@Carts.SumOrderProductAmount(list)</strong>元,@if(Carts.GetFullSendMinorOrderProduct(Model.PmId,Model.OrderProductList)==null){<text>已</text>}else{<text>未</text>}领取赠品</div>
    <div class="btn" onclick="window.location.href='@Url.Action("index")'"><a href="@Url.Action("index")">去购物车结算</a></div>
  </div>
  <div id="spec-list"> 
    <a id="spec-forward" class="spec-control disabled" href="javascript:;"></a>
    <div id="spec-items" class="spec-items">
      <ul>
      @foreach (OrderProductInfo info in list)
      {
        <li id="item@{@info.Pid}">
          <div class="p-img"><img width="50" height="50" src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@info.ShowImg"></div>
          <div class="p-total"><strong>￥@info.ShopPrice</strong> X @info.RealCount</div>
          <div class="p-detal" onclick="delCartProduct(@info.Pid)">删除</div>
        </li>
      }
      </ul>
    </div>
    <a id="spec-backward" class="spec-control disabled" href="javascript:;"></a>
  </div>
</div>

<div class="orderList">
<dl>
    <dt>排序:</dt>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 0 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 0){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 0)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 0)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}">销量</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 1 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 1){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 1)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 1)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">价格</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 2 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 2){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 2)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 2)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">评价</a></dd>
    <dd><a href="@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", 4 }, { "sortDirection", Model.SortDirection == 0 ? 1 : 0 }, { "page", 1 } })" class="@if (Model.SortColumn == 4){ <text>current</text>} @if (Model.SortDirection == 1 && Model.SortColumn == 4)
                                                                                                                                                                                                                                                                                                                                                         { <text>up</text>}
                                                                                                                                                                                                                                                                                                                                                         else if (Model.SortDirection == 0 && Model.SortColumn == 4)
                                                                                                                                                                                                                                                                                                                                                         { <text>down</text>}">人气</a></dd>
    <div class="clear"></div>
</dl>


<div class="orderPage">
    <span class="ProNB">共 @Model.PageModel.TotalCount 个商品</span>
    <span class="orderPageNB"><b>@if (Model.PageModel.TotalPages > 0){@Model.PageModel.PageNumber}else{<text>0</text>}</b>/@Model.PageModel.TotalPages</span>
    @if (Model.PageModel.HasPrePage)
    { 
        <a href = "@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", Model.SortColumn }, { "sortDirection", Model.SortDirection }, { "page", Model.PageModel.PrePageNumber } })">上一页</a>
    }
    else
    {
        <a href="javascript:;">上一页</a>
    }
    @if (Model.PageModel.HasNextPage)
    {
        <a href = "@Url.Action("fullsendmainproductlist", new RouteValueDictionary { { "pmId", Model.PmId }, { "startPrice", Model.StartPrice }, { "endPrice", Model.EndPrice }, { "sortColumn", Model.SortColumn }, { "sortDirection", Model.SortDirection }, { "page", Model.PageModel.NextPageNumber } })">下一页</a>
    }
    else
    {
        <a href="javascript:;">下一页</a>
    } 
    <div class="clear"></div>
</div>

</div>

<div class="proList">

<ul>
    @foreach (PartProductInfo info in Model.ProductList)
    {
        <li>
            <a href="@Url.Action("product", new RouteValueDictionary { { "pid", info.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb230_230/@info.ShowImg" width="100%" /><em>@info.Name</em></a>
            <b>¥@info.ShopPrice</b>
            <div class="info">
                <div class="star"><span class="star_yellow" style=" width:@Html.Raw((info.GetStarLevel() * 20).ToString())%;">&nbsp;</span></div>
                <a href="#">已有 @info.ReviewCount 人评价</a> 
            </div>
            <div class="info2"><span onclick="addToFavorite(@info.Pid)">加入收藏</span><a href="javascript:addProductToCart(@info.Pid, 1)" class="addShopping">加入购物车</a></div>
        </li>
    }
    <div class="clear"></div>
</ul>

@Html.WebPager(Model.PageModel)

</div>
</div>
<div class="clear"></div>
</div>


@Html.Partial("_footer")
</body>
</html>
